
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2386. -- [Ceoi2011]Team -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>2386: [Ceoi2011]Team</h2><span class=green>Time Limit: </span>30 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>128 MB<br><span class=green>Submit: </span>203&nbsp;&nbsp;<span class=green>Solved: </span>105<br>[<a href='submitpage.php?id=2386'>Submit</a>][<a href='problemstatus.php?id=2386'>Status</a>][<a href='bbs.php?id=2386'>Discuss</a>]</center><h2>Description</h2><div class=content><p><span style="font-size: medium"><img alt="" src="/JudgeOnline/upload/201107/d1.jpg" /></span></p>
<p></p>
<p><span style="font-size: medium">&nbsp; </span></p>
<div v:shape="_x0000_s1026">
<div><span style="font-size: medium"><span style="color: #000066"><span style="left: -3.5%; color: #d2761a; position: absolute; top: 0.1em">v</span></span><span style="color: #000066">格丁尼亚一所小学将举办运动日，其中最重要的活动是</span><span style="color: #000066">年度足球杯赛。参赛的球队是赛前临时组建的。不难想</span><span style="color: #000066">象每个小选手都想加入到最好的球队中。 </span></span></div>
<div><span style="font-size: medium"><span style="color: #000066"><span style="left: -3.51%; color: #d2761a; position: absolute; top: 0.1em">v</span></span><span style="color: #000066">体育老师</span><span style="color: #000066">Byteman</span><span style="color: #000066">负责组织这项比赛。为了满足所有选</span><span style="color: #000066">手的愿望，他决定把这些选手按他们各自的意愿分到各</span><span style="color: #000066">个球队。第</span><span style="color: #000066">i</span><span style="color: #000066">个选手（共</span><span style="color: #000066">n</span><span style="color: #000066">个，编号</span><span style="color: #000066">1</span><span style="color: #000066">&hellip;</span><span style="color: #000066">n</span><span style="color: #000066">）表示，如果球</span><span style="color: #000066">队少于</span><span style="color: #000066">a</span><span style="color: #000066; position: relative; top: 0.15em">i</span><span style="color: #000066">个队员，他就不愿意留在这个球队。 </span></span></div>
<div><span style="font-size: medium"><span style="color: #000066"><span style="left: -3.51%; color: #d2761a; position: absolute; top: 0.1em">v</span></span><span style="color: #000066">除满足选手们的要求外，</span><span style="color: #000066">Byteman</span><span style="color: #000066">希望球队的数目尽可</span><span style="color: #000066">能多。如果仍有多种选择，则要求人数最多的球队的队</span><span style="color: #000066">员人数尽可能少。这项任务难度不小，</span><span style="color: #000066">Byteman</span><span style="color: #000066">需要你</span><span style="color: #000066">的帮助。</span></span></div>
</div></div><h2>Input</h2><div class=content><p><span style="font-size: medium"><img alt="" src="/JudgeOnline/upload/201107/d2.jpg" /></span></p>
<p></p>
<div class="O1" v:shape="_x0000_s1026">
<div style="mso-line-spacing: '-272 20 0'; mso-margin-left-alt: 468; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><span style="font-size: medium"><span style="color: #000066; mso-color-index: 3"><span style="left: -3.16%; color: #2f86b1; font-family: 宋体; position: absolute; top: 0.16em; mso-color-index: 4; mso-special-format: bullet">◆</span></span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">第一行是整数</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">n(1</span><span lang="EN-US" style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">&le;</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">n</span><span lang="EN-US" style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">&le;</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">10^6</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">)</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">。然后是</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">n</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">行，其中第</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">i</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">行包括一</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">个整数</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">a</span><span lang="EN-US" style="color: #000066; position: relative; top: 0.15em; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-text-raise: -10%">i </span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">(1</span><span lang="EN-US" style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">&le;</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">a</span><span lang="EN-US" style="color: #000066; position: relative; top: 0.15em; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-text-raise: -10%">i</span><span lang="EN-US" style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">&le;</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">n</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">），表示满足第</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">i</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">个选手的球队的最少人数。 </span></span></div>
<div style="mso-line-spacing: '-272 20 0'; mso-margin-left-alt: 468; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><span style="font-size: medium"><span style="color: #000066; mso-color-index: 3"><span style="left: -3.62%; color: #2f86b1; font-family: 宋体; position: absolute; top: 0.16em; mso-color-index: 4; mso-special-format: bullet">◆</span></span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">至少</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">50</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">分的测试数据，</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">n</span><span lang="EN-US" style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">&le;</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">5000</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">。</span></span></div>
</div></div><h2>Output</h2><div class=content><p><span style="font-size: medium"><img alt="" src="/JudgeOnline/upload/201107/d3.jpg" /></span></p>
<p></p>
<div class="O" v:shape="_x0000_s1026" style="mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><span style="font-size: medium"><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">第一行输出</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">1</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">个整数</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">t</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">，表示可能组建球队的最大数目。接下来的</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">t</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">行是对各个球队的描述，其中第</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">i</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">行包含</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">1</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">个整</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">数</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">s</span><span lang="EN-US" style="color: #000066; position: relative; top: 0.15em; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-text-raise: -10%">i</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">（</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">1</span><span lang="EN-US" style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">&le;</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">s</span><span lang="EN-US" style="color: #000066; position: relative; top: 0.15em; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-text-raise: -10%">i</span><span lang="EN-US" style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">&le;</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">n</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">）</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">,</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">表示第</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">i</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">个球队的人数，然后是</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">s</span><span lang="EN-US" style="color: #000066; position: relative; top: 0.15em; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-text-raise: -10%">i</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">个整数</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">k</span><span lang="EN-US" style="color: #000066; position: relative; top: 0.15em; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-text-raise: -10%">1</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">，</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">k</span><span lang="EN-US" style="color: #000066; position: relative; top: 0.15em; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-text-raise: -10%">2</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">，</span><span lang="EN-US" style="color: #000066; font-family: Arial; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">&hellip;</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">，</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">k</span><span lang="EN-US" style="color: #000066; position: relative; top: 0.15em; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-text-raise: -10%">s</span><span lang="EN-US" style="color: #000066; position: relative; top: 0.3em; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-text-raise: -20%">i </span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">(1</span><span lang="EN-US" style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">&le;</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">k</span><span lang="EN-US" style="color: #000066; position: relative; top: 0.15em; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-text-raise: -10%">j</span><span lang="EN-US" style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">&le;</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">n,j=1,2,&hellip;,s</span><span lang="EN-US" style="color: #000066; position: relative; top: 0.15em; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-text-raise: -10%">i</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">), </span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">表示属于第</span><span lang="EN-US" style="color: #000066; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN">i</span><span style="color: #000066; font-family: 黑体; mso-color-index: 3; mso-fareast-font-family: 黑体; mso-hansi-font-family: Arial">个球队的队员的编号。</span></span></div></div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>5<br />
2<br />
1<br />
2<br />
2<br />
3</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>2<br />
</span></div><h2>HINT</h2>
			<div class=content><p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search='></a></p></div><center>[<a href='submitpage.php?id=2386'>Submit</a>][<a href='problemstatus.php?id=2386'>Status</a>][<a href='bbs.php?id=2386'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
